package com.poker.service;

import com.landlords.constants.PokerConstatns;
import com.landlords.model.Poker;
import com.poker.R;

public class DouDizhuService {

	/**
	 * 根据扑克牌获取对应的图片在资源中的id
	 * 
	 * @param poker
	 * @return
	 */
	public static int getPokerID(Poker poker) {
		int color = poker.getColor();
		int num = poker.getNum();
		int pokerId = 0;
		if (color == PokerConstatns.POKER_COLOR_BOX) {
			switch (num) {
			case PokerConstatns.POKER_NUM_ONE:
				pokerId = R.drawable.box_a;
				break;
			case PokerConstatns.POKER_NUM_TWO:
				pokerId = R.drawable.box_2;
				break;
			case PokerConstatns.POKER_NUM_THREE:
				pokerId = R.drawable.box_3;
				break;
			case PokerConstatns.POKER_NUM_FOUR:
				pokerId = R.drawable.box_4;
				break;
			case PokerConstatns.POKER_NUM_FIVE:
				pokerId = R.drawable.box_5;
				break;
			case PokerConstatns.POKER_NUM_SIX:
				pokerId = R.drawable.box_6;
				break;
			case PokerConstatns.POKER_NUM_SEVEN:
				pokerId = R.drawable.box_7;
				break;
			case PokerConstatns.POKER_NUM_EIGHT:
				pokerId = R.drawable.box_8;
				break;
			case PokerConstatns.POKER_NUM_NINE:
				pokerId = R.drawable.box_9;
				break;
			case PokerConstatns.POKER_NUM_TEN:
				pokerId = R.drawable.box_a;
				break;
			case PokerConstatns.POKER_NUM_ELEVEN:
				pokerId = R.drawable.box_j;
				break;
			case PokerConstatns.POKER_NUM_TWELVE:
				pokerId = R.drawable.box_q;
				break;
			case PokerConstatns.POKER_NUM_THIRTEEN:
				pokerId = R.drawable.box_k;
				break;
			default:
				break;
			}
		}
		if (color == PokerConstatns.POKER_COLOR_HEARTS) {
			switch (num) {
			case PokerConstatns.POKER_NUM_ONE:
				pokerId = R.drawable.hearts_a;
				break;
			case PokerConstatns.POKER_NUM_TWO:
				pokerId = R.drawable.hearts_2;
				break;
			case PokerConstatns.POKER_NUM_THREE:
				pokerId = R.drawable.hearts_3;
				break;
			case PokerConstatns.POKER_NUM_FOUR:
				pokerId = R.drawable.hearts_4;
				break;
			case PokerConstatns.POKER_NUM_FIVE:
				pokerId = R.drawable.hearts_5;
				break;
			case PokerConstatns.POKER_NUM_SIX:
				pokerId = R.drawable.hearts_6;
				break;
			case PokerConstatns.POKER_NUM_SEVEN:
				pokerId = R.drawable.hearts_7;
				break;
			case PokerConstatns.POKER_NUM_EIGHT:
				pokerId = R.drawable.hearts_8;
				break;
			case PokerConstatns.POKER_NUM_NINE:
				pokerId = R.drawable.hearts_9;
				break;
			case PokerConstatns.POKER_NUM_TEN:
				pokerId = R.drawable.hearts_a;
				break;
			case PokerConstatns.POKER_NUM_ELEVEN:
				pokerId = R.drawable.hearts_j;
				break;
			case PokerConstatns.POKER_NUM_TWELVE:
				pokerId = R.drawable.hearts_q;
				break;
			case PokerConstatns.POKER_NUM_THIRTEEN:
				pokerId = R.drawable.hearts_k;
				break;
			default:
				break;
			}
		}
		if (color == PokerConstatns.POKER_COLOR_PLUMFLOWER) {
			switch (num) {
			case PokerConstatns.POKER_NUM_ONE:
				pokerId = R.drawable.plumflower_a;
				break;
			case PokerConstatns.POKER_NUM_TWO:
				pokerId = R.drawable.plumflower_2;
				break;
			case PokerConstatns.POKER_NUM_THREE:
				pokerId = R.drawable.plumflower_3;
				break;
			case PokerConstatns.POKER_NUM_FOUR:
				pokerId = R.drawable.plumflower_4;
				break;
			case PokerConstatns.POKER_NUM_FIVE:
				pokerId = R.drawable.plumflower_5;
				break;
			case PokerConstatns.POKER_NUM_SIX:
				pokerId = R.drawable.plumflower_6;
				break;
			case PokerConstatns.POKER_NUM_SEVEN:
				pokerId = R.drawable.plumflower_7;
				break;
			case PokerConstatns.POKER_NUM_EIGHT:
				pokerId = R.drawable.plumflower_8;
				break;
			case PokerConstatns.POKER_NUM_NINE:
				pokerId = R.drawable.plumflower_9;
				break;
			case PokerConstatns.POKER_NUM_TEN:
				pokerId = R.drawable.plumflower_a;
				break;
			case PokerConstatns.POKER_NUM_ELEVEN:
				pokerId = R.drawable.plumflower_j;
				break;
			case PokerConstatns.POKER_NUM_TWELVE:
				pokerId = R.drawable.plumflower_q;
				break;
			case PokerConstatns.POKER_NUM_THIRTEEN:
				pokerId = R.drawable.plumflower_k;
				break;
			default:
				break;
			}
		}
		if (color == PokerConstatns.POKER_COLOR_SPADES) {
			switch (num) {
			case PokerConstatns.POKER_NUM_ONE:
				pokerId = R.drawable.spades_a;
				break;
			case PokerConstatns.POKER_NUM_TWO:
				pokerId = R.drawable.spades_2;
				break;
			case PokerConstatns.POKER_NUM_THREE:
				pokerId = R.drawable.spades_3;
				break;
			case PokerConstatns.POKER_NUM_FOUR:
				pokerId = R.drawable.spades_4;
				break;
			case PokerConstatns.POKER_NUM_FIVE:
				pokerId = R.drawable.spades_5;
				break;
			case PokerConstatns.POKER_NUM_SIX:
				pokerId = R.drawable.spades_6;
				break;
			case PokerConstatns.POKER_NUM_SEVEN:
				pokerId = R.drawable.spades_7;
				break;
			case PokerConstatns.POKER_NUM_EIGHT:
				pokerId = R.drawable.spades_8;
				break;
			case PokerConstatns.POKER_NUM_NINE:
				pokerId = R.drawable.spades_9;
				break;
			case PokerConstatns.POKER_NUM_TEN:
				pokerId = R.drawable.spades_a;
				break;
			case PokerConstatns.POKER_NUM_ELEVEN:
				pokerId = R.drawable.spades_j;
				break;
			case PokerConstatns.POKER_NUM_TWELVE:
				pokerId = R.drawable.spades_q;
				break;
			case PokerConstatns.POKER_NUM_THIRTEEN:
				pokerId = R.drawable.spades_k;
				break;
			default:
				break;
			}
		}
		if (color == PokerConstatns.POKER_COLOR_KING) {
			switch (num) {
			case PokerConstatns.POKER_NUM_OLD_KING:
				pokerId = R.drawable.old_king;
				break;
			case PokerConstatns.POKER_NUM_YONG_KING:
				pokerId = R.drawable.young_king;
				break;
			default:
				break;
			}
		}
		return pokerId;
	}
}
